#ifndef __BOARD_CONFIG_H__
#define __BOARD_CONFIG_H__

#ifdef __cplusplus
extern "C" {
#endif

#include "stm32f10x.h"

//#define USE_STEP_DEBUG  1
#define USE_RTC         1
#define USE_LCD         1
#define USE_KEYBOARD    1
#define USE_USB         1
#define USE_USB_MSD     1
#define USE_SDCARD      1




/*
 *	Motor number for encoder
 */
#define MX_ENCODER      2


#if (USE_USB == 1)
#define USB_DISCONNECT_PORT     GPIOC
#define USB_DISCONNECT_PIN      GPIO_Pin_13
#define USB_CONNECTED()         GPIO_ResetBits(USB_DISCONNECT_PORT, USB_DISCONNECT_PIN)
#define USB_DISCONNECTED()      GPIO_ResetBits(USB_DISCONNECT_PORT, USB_DISCONNECT_PIN)
#endif

#define LIMIT_X_PORT            GPIOA
#define LIMIT_X_PIN             GPIO_Pin_0
#define LIMIT_X_STATE           0
#define LIMIT_Y_PORT            GPIOD
#define LIMIT_Y_PIN             GPIO_Pin_3
#define LIMIT_Y_STATE           0
#define LIMIT_Z_PORT            GPIOB
#define LIMIT_Z_PIN             GPIO_Pin_8
#define LIMIT_Z_STATE           0



void Enter_LowPowerMode(void);
void Leave_LowPowerMode(void);
void SystemStartup(void);



#define BULK_MAX_PACKET_SIZE    64

#endif
